//
// CWaterModel.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;

public class CWaterModel extends CTransformShape {
  private long swigCPtr;

  public CWaterModel(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CWaterModel_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CWaterModel obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CWaterModel(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CWaterModel() {
    this(nel3dJNI.new_CWaterModel(), true);
  }

  public void init() {
    nel3dJNI.CWaterModel_init(swigCPtr, this);
  }

  public static void registerBasic() {
    nel3dJNI.CWaterModel_registerBasic();
  }

  public static CTransform creator() {
    long cPtr = nel3dJNI.CWaterModel_creator();
    return (cPtr == 0) ? null : new CTransform(cPtr, false);
  }

  public ITrack getDefaultTrack(long valueId) {
    long cPtr = nel3dJNI.CWaterModel_getDefaultTrack(swigCPtr, this, valueId);
    return (cPtr == 0) ? null : new ITrack(cPtr, false);
  }

  public long getWaterHeightMapID() {
    return nel3dJNI.CWaterModel_getWaterHeightMapID(swigCPtr, this);
  }

  public float getHeightFactor() {
    return nel3dJNI.CWaterModel_getHeightFactor(swigCPtr, this);
  }

  public float getHeight(SWIGTYPE_p_NLMISC__CVector2f pos) {
    return nel3dJNI.CWaterModel_getHeight(swigCPtr, this, SWIGTYPE_p_NLMISC__CVector2f.getCPtr(pos));
  }

  public float getAttenuatedHeight(SWIGTYPE_p_NLMISC__CVector2f pos, CVector viewer) {
    return nel3dJNI.CWaterModel_getAttenuatedHeight(swigCPtr, this, SWIGTYPE_p_NLMISC__CVector2f.getCPtr(pos), CVector.getCPtr(viewer), viewer);
  }

  public void traverseRender() {
    nel3dJNI.CWaterModel_traverseRender(swigCPtr, this);
  }

  public boolean clip() {
    return nel3dJNI.CWaterModel_clip(swigCPtr, this);
  }

  public long getNumWantedVertices() {
    return nel3dJNI.CWaterModel_getNumWantedVertices(swigCPtr, this);
  }

  public long fillVB(SWIGTYPE_p_void dataStart, long startTri, IDriver drv) {
    return nel3dJNI.CWaterModel_fillVB(swigCPtr, this, SWIGTYPE_p_void.getCPtr(dataStart), startTri, IDriver.getCPtr(drv), drv);
  }

  public static void setupVertexBuffer(CVertexBuffer vb, long numWantedVertices, IDriver drv) {
    nel3dJNI.CWaterModel_setupVertexBuffer(CVertexBuffer.getCPtr(vb), vb, numWantedVertices, IDriver.getCPtr(drv), drv);
  }

  public void debugDumpMem(SWIGTYPE_p_p_void clippedPolyBegin, SWIGTYPE_p_p_void clippedPolyEnd) {
    nel3dJNI.CWaterModel_debugDumpMem(swigCPtr, this, SWIGTYPE_p_p_void.getCPtr(clippedPolyBegin), SWIGTYPE_p_p_void.getCPtr(clippedPolyEnd));
  }

  public void debugClearClippedPoly() {
    nel3dJNI.CWaterModel_debugClearClippedPoly(swigCPtr, this);
  }

  public void set_Prev(SWIGTYPE_p_p_NL3D__CWaterModel value) {
    nel3dJNI.CWaterModel__Prev_set(swigCPtr, this, SWIGTYPE_p_p_NL3D__CWaterModel.getCPtr(value));
  }

  public SWIGTYPE_p_p_NL3D__CWaterModel get_Prev() {
    long cPtr = nel3dJNI.CWaterModel__Prev_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_p_NL3D__CWaterModel(cPtr, false);
  }

  public void set_Next(CWaterModel value) {
    nel3dJNI.CWaterModel__Next_set(swigCPtr, this, CWaterModel.getCPtr(value), value);
  }

  public CWaterModel get_Next() {
    long cPtr = nel3dJNI.CWaterModel__Next_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CWaterModel(cPtr, false);
  }

  public void unlink() {
    nel3dJNI.CWaterModel_unlink(swigCPtr, this);
  }

  public void link() {
    nel3dJNI.CWaterModel_link(swigCPtr, this);
  }

}
